package com.songlanyun.modules.singlegoods.controller.api;

import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.common.validator.ValidatorUtils;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.singlegoods.entity.UnderStockRecordEntity;
import com.songlanyun.modules.singlegoods.model.UnderStockRecordDTO;
import com.songlanyun.modules.singlegoods.service.UnderStockRecordService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Validator;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;


/**
 * 库存不足记录表
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-03-18 15:09:05
 */
@RestController
@RequestMapping("api/singlegoods/understockrecord")
public class UnderStockRecordApiController extends AbstractApiController {
    @Autowired
    private UnderStockRecordService underStockRecordService;

    /**
     * 库存不足保存记录
     */
    @PostMapping("/save")
    //@RequiresPermissions("singlegoods:understockrecord:list")
    public R save(@RequestBody UnderStockRecordDTO dto) {
        ValidatorUtils.validateEntity(dto);
        underStockRecordService.add(dto);
        return R.ok();
    }

}
